// $ANTLR : "Sint.g" -> "Sint.java"$

package pl.prac03;

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;

public class Sint extends antlr.LLkParser       implements SintTokenTypes
 {

	private String texto="";	
	public String toString() { return texto; }	

protected Sint(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
}

public Sint(TokenBuffer tokenBuf) {
  this(tokenBuf,1);
}

protected Sint(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
}

public Sint(TokenStream lexer) {
  this(lexer,1);
}

public Sint(ParserSharedInputState state) {
  super(state,1);
  tokenNames = _tokenNames;
}

	public final void entrada() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			{
			_loop741:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					variable();
					break;
				}
				case IF:
				{
					condicion();
					break;
				}
				case WHILE:
				{
					cond_while();
					break;
				}
				case FOR:
				{
					cond_for();
					break;
				}
				default:
				{
					break _loop741;
				}
				}
			} while (true);
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_0);
		}
	}
	
	public final void asignacion() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(IDENT);
			match(5);
			{
			switch ( LA(1)) {
			case NUMERO:
			{
				match(NUMERO);
				break;
			}
			case BOOLEANO:
			{
				match(BOOLEANO);
				break;
			}
			case CADENA:
			{
				match(CADENA);
				break;
			}
			case RUTA:
			{
				match(RUTA);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(10);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void variable() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(SET);
			match(12);
			match(IDENT);
			match(5);
			{
			switch ( LA(1)) {
			case NUMERO:
			{
				match(NUMERO);
				break;
			}
			case BOOLEANO:
			{
				match(BOOLEANO);
				break;
			}
			case CADENA:
			{
				match(CADENA);
				break;
			}
			case RUTA:
			{
				match(RUTA);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(10);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void condicion() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(IF);
			match(14);
			match(12);
			match(IDENT);
			match(15);
			match(16);
			{
			int _cnt748=0;
			_loop748:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					variable();
					break;
				}
				case IF:
				{
					condicion();
					break;
				}
				case WHILE:
				{
					cond_while();
					break;
				}
				case FOR:
				{
					cond_for();
					break;
				}
				default:
				{
					if ( _cnt748>=1 ) { break _loop748; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt748++;
			} while (true);
			}
			match(17);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void cond_while() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(WHILE);
			match(14);
			match(12);
			match(IDENT);
			match(OPERADOR2);
			{
			switch ( LA(1)) {
			case NUMERO:
			{
				match(NUMERO);
				break;
			}
			case BOOLEANO:
			{
				match(BOOLEANO);
				break;
			}
			case CADENA:
			{
				match(CADENA);
				break;
			}
			case RUTA:
			{
				match(RUTA);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(15);
			match(16);
			{
			int _cnt752=0;
			_loop752:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					variable();
					break;
				}
				case IF:
				{
					condicion();
					break;
				}
				case WHILE:
				{
					cond_while();
					break;
				}
				case FOR:
				{
					cond_for();
					break;
				}
				default:
				{
					if ( _cnt752>=1 ) { break _loop752; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt752++;
			} while (true);
			}
			match(17);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void cond_for() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(FOR);
			match(14);
			match(12);
			match(IDENT);
			match(5);
			match(NUMERO);
			match(10);
			match(12);
			match(IDENT);
			match(OPERADOR2);
			{
			switch ( LA(1)) {
			case NUMERO:
			{
				match(NUMERO);
				break;
			}
			case IDENT:
			{
				match(IDENT);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(10);
			match(12);
			match(IDENT);
			match(ITERACION);
			match(15);
			match(16);
			{
			int _cnt756=0;
			_loop756:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					variable();
					break;
				}
				case IF:
				{
					condicion();
					break;
				}
				case WHILE:
				{
					cond_while();
					break;
				}
				case FOR:
				{
					cond_for();
					break;
				}
				default:
				{
					if ( _cnt756>=1 ) { break _loop756; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt756++;
			} while (true);
			}
			match(17);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"IDENT",
		"\"=\"",
		"NUMERO",
		"BOOLEANO",
		"CADENA",
		"RUTA",
		"\";\"",
		"SET",
		"\"$\"",
		"IF",
		"\"(\"",
		"\")\"",
		"\"{\"",
		"\"}\"",
		"WHILE",
		"OPERADOR2",
		"FOR",
		"ITERACION"
	};
	
	private static final long[] mk_tokenSet_0() {
		long[] data = { 2L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
	private static final long[] mk_tokenSet_1() {
		long[] data = { 1452050L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
	
	}
